package 天梯赛.tts44.tss20;

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;

        int n = Integer.parseInt(br.readLine());
        int a[] = new int[(int) (1e5 + 10)];

        while (n-- > 0) {
            st = new StringTokenizer(br.readLine());
            int k = Integer.parseInt(st.nextToken());
            int temp = k;
            while (temp-- > 0) {
                int x = Integer.parseInt(st.nextToken());
                if (k > 1) {
                    a[x]++;
                }
            }
        }

        // 读取查询行
        st = new StringTokenizer(br.readLine());
        int t = Integer.parseInt(st.nextToken());
        Set<Integer> set = new HashSet<>();
        boolean flag = true;
        List<Integer> list = new ArrayList<>();

        // 直接读取所有查询 ID，避免 StringTokenizer 用完 token
        String[] queryIds = br.readLine().split(" ");
        for (String idStr : queryIds) {
            int x = Integer.parseInt(idStr);
            if (a[x] == 0 && !set.contains(x)) {
                list.add(x);
                set.add(x);
                flag = false;
            }
        }

        // 保持原有输出逻辑不变
        if (flag) {
            System.out.println("No one is handsome");
        } else {
            for (int i = 0; i < list.size() - 1; i++) {
                System.out.printf("%05d", list.get(i));
                System.out.print(" ");
            }
            System.out.printf("%05d", list.get(list.size() - 1));
        }
    }
}
